package com.woniuxy.config;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

@Document(indexName = "movie")
@Data
public class ElasticSearchConfig {
    @Id
    private String id;
    @Field(type = FieldType.Text,analyzer = "ik_smart")
    private String movieName;
    @Field(type = FieldType.Text,analyzer = "ik_smart")
    private String type;
    @Field(type = FieldType.Integer)
    private String status;
    @Field(type = FieldType.Integer)
    private String timelength;
    @Field(type = FieldType.Date,format = DateFormat.date_optional_time)
    private LocalDateTime startTime;
}
//{
//        "id":"000",
//        "movieName":"严厉",
//        "type":"魔幻片",
//        "status":1,
//        "timelength":350,
//        "startTime": "2021-06-09T06:11Z"
//        }